doc,test: clarify --eval syntax for leading '-' scripts#61962
doc,test: clarify --eval syntax for leading '-' scripts#61962jorgitin02 wants to merge 2 commits intonodejs:mainfrom
Conversation
Fixes: nodejs#43397 Signed-off-by: jorge guerrero <grrr.jrg@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61962 +/- ##
==========================================
+ Coverage 88.84% 89.73% +0.89%
==========================================
Files 674 672 -2
Lines 204957 204545 -412
Branches 39309 39276 -33
==========================================
+ Hits 182087 183557 +1470
+ Misses 15088 13306 -1782
+ Partials 7782 7682 -100
🚀 New features to boost your workflow:
|
addaleax
left a comment
There was a problem hiding this comment.
From the ticket:
For users who prefer setting mandatory option arguments rather than positional arguments, node --print --eval=-42 already works. :)
I think that's the right solution here. Adding behavior that depends on the specific text passed to the flag is going to be dangerous; now you cannot know anymore whether node -e -<text> will work or throw, it's going to depend on the specific value of text (i.e. the behavior is less consistent now, not more).
Refs: nodejs#43397 Signed-off-by: jorge guerrero <grrr.jrg@gmail.com>
|
Thanks for the review feedback. I pushed a follow-up that removes the I also kept the safety behavior for Could you please take another look when you have a moment? |
|
Heads up: all GitHub Actions workflows for this latest push are currently in I don't have permissions to rerun/approve those runs from my fork. Could a maintainer please click Approve and run workflows? For local verification on my side, I ran:
|
Refs: #43397
Summary
-e -<text>--eval=<script>(for example--eval=-42)test/parallel/test-cli-eval.jsto cover--eval=-42,--eval=-0, and keep-e -pas a missing-argument errorTesting